package com.onpositive.realmview.search;

public class Term {

	final String label;
	final String term;
	public Term(String label, String term) {
		super();
		this.label = label;
		this.term = term;
	}
	public String getLabel() {
		return term;
	}
	public String getTerm() {
		return term;
	}
	
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		//result = prime * result + ((label == null) ? 0 : label.hashCode());
		result = prime * result + ((term == null) ? 0 : term.hashCode());
		return result;
	}
	
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Term other = (Term) obj;
//		if (label == null) {
//			if (other.label != null)
//				return false;
//		} else if (!label.equals(other.label))
//			return false;
		if (term == null) {
			if (other.term != null)
				return false;
		} else if (!term.equals(other.term))
			return false;
		return true;
	}
}
